<template>
  <div
    class="notice-item-content"
    @mouseenter="enters($event)"
    @mouseleave="leaver($event)"
    @click="clickItem"
  >
    <el-image class="image" :src="GLOBAL.BASE_URL + 'image/' + data.titlePic " fit="fill"></el-image>
    <div style="width:80% ;height:100%">
      <h3 class="noticeTitle">{{data.noticeTitle}}</h3>
      <p class="introduction">{{data.introduction}}</p>
      <div style="display:flex;height:20px">
        <span class="by-span" style="width:50%">{{data.createTime}}</span>
        <span class="by-span" style="width:50%">阅读数量：{{data.readNum}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Object,
    },
  },
  methods: {
    clickItem() {
      this.$router.push({ name: "NoticeDetail", params: { data: this.data } });
    },
    enters(event) {
      event.target.style.cursor = "pointer";
      event.target.style.border = "1px solid #00cccc";
    },
    leaver(event) {
      event.target.style.border = null;
    },
  },
};
</script>

<style>
.notice-item-content {
  display: flex;
  width: 90%;
  height: 200px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgb(219, 214, 214);
  margin-right: 10px;
  margin-left: 10px;
}
.image {
  width: 20%;
  height: 180px;
  margin-top: 10px;
  padding-right: 10px;
  padding-left: 10px;
}
.noticeTitle {
  margin: 0;
  padding-top: 5px;
  height: 30px;
}
.introduction {
  margin: 0;
  height: 150px;
}
.by-span {
  float: left;
  color: rgba(21, 26, 48, 0.5);
  font-size: 14px;
  line-height: 22px;
}
</style>